FROM ubuntu:16.04
MAINTAINER huangchengwu <751164212@qq.com>
Run  apt-get update && apt-get -y install  make ansible apache2 jq mysql-client screen  &&  apt-get clean

RUN  sed -i 's/#Include/Include/g;s#/var/www/html#/var/www#g' /etc/apache2/sites-enabled/000-default.conf \
    && sed -i '/SymLinksIfOwnerMatch/a Order allow,deny' /etc/apache2/conf-available/serve-cgi-bin.conf \
    && sed -i '/SymLinksIfOwnerMatch/a  Allow from all' /etc/apache2/conf-available/serve-cgi-bin.conf \
    && sed -i 's/None/All/g' /etc/apache2/conf-available/serve-cgi-bin.conf \
    && sed -i '/Directory>/a AddHandler cgi-script  .cgi .sh .py ' /etc/apache2/conf-available/serve-cgi-bin.conf \
    && sed -i '/.so/a AddHandler cgi-script  .cgi .sh .py' /etc/apache2/mods-available/cgid.load \
    && sed -i 's/html/cgi/g'   /etc/apache2/mods-available/dir.conf\
    && ln -s /etc/apache2/mods-available/cgid.load /etc/apache2/mods-enabled \
    && ln -s /etc/apache2/mods-available/headers.load /etc/apache2/mods-enabled \
    && sed -i 's#/usr/lib/cgi-bin#/var/www#g'  /etc/apache2/conf-available/serve-cgi-bin.conf  \
    && mkdir -p  /var/www/

EXPOSE 80

CMD ["/usr/sbin/apache2ctl","-D","FOREGROUND"]